<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>巨丰App</title>
    <style>
        .selector {
            background-image: url('./jfApp.jpg');
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center center;
            position: relative;
        }

        .btn {
            position: absolute;
            bottom: 100px;
            left: 38%;
            display: inline-block;
            padding: 12px 24px;
            font-size: 16px;
            font-weight: bold;
            text-align: center;
            text-decoration: none;
            border: none;
            border-radius: 4px;
            color: #ffffff;
            background-color: #4caf50;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
    </style>
</head>

<body>
    <div class="selector " style="border: 0;margin: 0 auto;width: 98wh;height: 98vh;background-color: brown;">
        <button id="downloadBtn" class="btn">点击下载</button>
    </div>
    <script>
        function isWeChat() {
            var userAgent = navigator.userAgent.toLowerCase();
            if (userAgent.match(/micromessenger/i) === 'micromessenger') {
                return true;
            } else {
                return false;
            }
        }

        window.onload = function () {
            if (isWeChat()) {
                alert('请在浏览器中打开页面！');
            }
        };

        if (!isWeChat()) {
            const downloadBtn = document.getElementById('downloadBtn');
            downloadBtn.addEventListener('click', function () {
                window.open(`${window.location.protocol}//${window.location.host}/api/minio/file/download/zzy`)
                // window.open('http://120.196.185.227:7576/api/minio/file/download/zzy')
            });
        } else {
            alert('请在浏览器中打开页面！');
        }
    </script>
</body>

</html>